<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start();
/**
 *
 * @author RAMIANDRISOA Domoina
 * @tel 261 34 13 306 32
 * @email domonaalivelo@gmail.com
 */
class Lab extends CI_Controller {
    //création attribut id_patient = pour accèder à l'identifiant du patient au nniveau de la classe

	function __construct()
	    {
		parent::__construct();
		$this->load->helper('url');
		$this->load->helper(array('form', 'url'));
		$this->load->library('form_validation');
		$this->load->library('session');
                $this->load->library('input');
	    }
    function ajout (){
                $this->form_validation->set_rules('email','"Adresse mail"','trim|required|xss_clean|valid_email|is_unique[patient.email]|is_unique[clinique.email]');
                $this->form_validation->set_rules('civilite','"Civilite"','required');
                $this->form_validation->set_rules('nom','"Nom"','trim|required|xss_clean');
                $this->form_validation->set_rules('prenom','"Prenom"','trim|required|xss_clean');
                $this->form_validation->set_rules('password_patient','"Mot de passe"','trim|required|xss_clean');
                $this->form_validation->set_rules('lu','"Cocher condition d\'utilisation"','required');
		if ($this->form_validation->run()==FALSE){
                    echo '<script>document.location="../";</script>';
                } else {
                    $email = $this->input->post('email');
                    $email = $this->input->post('civilite');
                    $nom = $this->input->post('nom');
                    $prenom = $this->input->post('prenom');
                    $lu = $this->input->post('lu');
                    $password_patient = $this->input->post('password_patient');
                    echo "<br /> MAIL :".$email;
                    echo "<br /> NOM :".$nom;
                    echo "<br /> PRENOM :".$prenom;
                    echo "<br /> PASS :".$password_patient;
                    echo "<br /> LU :".$lu;
	}

}
}
?>
